package xhwl.insurance.http.api;

import com.google.gson.Gson;

import okhttp3.RequestBody;
import rx.Observable;
import xhwl.android.common.util.SPUtil;
import xhwl.insurance.Constant;
import xhwl.insurance.http.ApiService;
import xhwl.retrofitrx.BaseApi;

/**
 * Created by admin on 2017/6/7.
 * 心电阅片订单列表
 */

public class OrderdetailApi extends BaseApi {
    OrderdetailReq req;

    public OrderdetailApi(String order_id) {
        req = new OrderdetailReq(order_id);
    }

    @Override
    protected Observable getObservable() {
        RequestBody requestBody = RequestBody.create(okhttp3.MediaType.parse("application/json; charset=utf-8"), new Gson().toJson(req));
        return retrofit.create(ApiService.class).getorderdetail(requestBody);
    }

    class OrderdetailReq {

        /**
         * order_id : 41709
         * link_mobile : 13263266381
         * yw_id : 2
         */

        private String order_id;
        private String link_mobile;
        private String yw_id;

        public OrderdetailReq(String order_id) {
            this.order_id = order_id;
            this.link_mobile = SPUtil.getPersonInfoSp().getString(SPUtil.SPPersonInfo.LINK_MOBILE, "");
            this.yw_id = Constant.YW_ID;
        }
    }
}
